package io.coderyeah.product.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @TableName t_product
 */
@TableName(value = "t_product")
@Data
public class Product implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 服务名称
     */
    private String name;

    /**
     * 成本价
     */
    private BigDecimal costprice;

    /**
     * 售价
     */
    private BigDecimal saleprice;

    /**
     * 存放fastdfs地址，多个资源使用，分割
     */
    private String resources;

    /**
     * 销售数量
     */
    private Long salecount;

    /**
     * 状态：0下架 1上架
     */
    private Long state = 0L;

    /**
     * 下架时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date offsaletime;

    /**
     * 上架时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date onsaletime;

    /**
     *
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createtime = new Date();

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 服务详情
     */
    @TableField(exist = false)
    private ProductDetail productDetail;

}